#include<dirent.h>
#include<sys/stat.h>
#include<stdio.h>

void   check_dir(char*   dirname)  
{  
  DIR*   p;  
  struct   dirent*   dirlist;  
  struct   stat   filestat;  
  char   indir[1024] = {0};  
       
  p=opendir(dirname);  
  while((dirlist=readdir(p))!=NULL)    
    {  
      sprintf(indir,"%s/%s",dirname,dirlist->d_name);  
      stat(indir,&filestat);  
      if(S_ISREG(filestat.st_mode))    
        {  
          printf("%s\n",indir);  
        }  
      else    
        {  
          if(S_ISDIR(filestat.st_mode)&&dirlist->d_name[0]!='.')    
            {  
              check_dir(indir);
              //continue;
            }  
        }  
    }
  closedir(p);
}

int main()
{
  check_dir("/c/workspace");
  return 0;
}
